package crudfx.util;
import javafx.animation.*;
/**
 * @profile desktop
 * @author Sergey Surikov
 */
public class WaitFor{
    public var isDone:Boolean;
    public var action:function():Void;
    public function start():Void{
        var timeline:Timeline=Timeline{
            repeatCount:Timeline.INDEFINITE
            keyFrames:KeyFrame{
                time:0.1s
                action:function():Void{
                    if(isDone){
                        timeline.stop();
                        action();
                        }
                    }
                }
            };
        timeline.play();
        }
    }
